home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha Extra 2004 January / CyberMycha Extra 1-2004 (Poland) (Disc 2).bin / Pippi / common.cst / 00021_soundScript.ls < prev    next >
Encoding:
Text File  |  2001-09-04  |  1.6 KB  |  56 lines

  1. property respSndList, respSndSource
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. ----------------------------------------------------------------------------------------------------
  8. --respondSounds ligger i castlib 3 internt, k├╢rs i kanal 2, laddas in automatiskt om dom finns.
  9.  
  10. on respondSnd me, pRandom, pList, pDelete, pRecover
  11.   if random(pRandom) = 1 then
  12.     if soundBusy(2) = 1 then
  13.       exit
  14.     else
  15.       if respSndList[pList].count > 0 then
  16.         Num = respSndList[pList].count
  17.         choise = random(Num)
  18.         sound(2).play(member(respSndList[pList][choise], 3))
  19.         if pDelete = 1 then
  20.           respSndList[pList].deleteAt(choise)
  21.         end if
  22.         if respSndList[pList].count = 0 and pRecover = 1 then
  23.           me.readRespondList(pList)
  24.         end if
  25.       end if
  26.     end if
  27.   end if
  28. end
  29.  
  30. on readRespondList me, pList
  31.   respSndList[pList] = respSndSource[pList]
  32. end
  33.  
  34. on initRespondlist me
  35.   respSndList = []
  36.   respSndSource = []
  37.   num = (the number of members of castlib 3)
  38.   if member(num, 3).type <> #sound then
  39.     num = (the number of members of castlib 3) - 1
  40.   end if
  41.   listNum = (value(member(num, 3).name))[1]
  42.   repeat with n = 1 to listNum
  43.     respSndList[n] = []
  44.     respSndSource[n] = []
  45.   end repeat
  46.   repeat with n = 1 to num
  47.     if member(n, 3).type = #sound then
  48.       nomen = value(member(n, 3).name)
  49.       respSndList[nomen[1]][nomen[2]] = member(n, 3).name
  50.       respSndSource[nomen[1]][nomen[2]] = member(n, 3).name
  51.     end if
  52.   end repeat
  53. end
  54.  
  55.  
  56. --------------------------  --------------------------  --------------------------  --------------------------